package com.zb.controller;

import com.zb.mapper.UserMapper;
import com.zb.pojo.User;
import com.zb.service.UserService;
import org.junit.Test;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;
import org.springframework.stereotype.Controller;

import javax.annotation.Resource;

public class UserController {
    @Resource(name = "userService")
    private UserService userService;

    @Test
    public void test1() {
                ApplicationContext applicationContext = new
                ClassPathXmlApplicationContext("applicationContext.xml");
        UserService service = applicationContext.getBean(UserService.class);
        service.save();
    }

}
